/*
 * StrategicGame.cpp
 *
 * Copyright 2012 Fabian Wenzelmann, Nikolaus Mayer
 *
 * This file is part of ss12-gtprojects.
 *
 * ss12-gtprojects is free software: you
 * can redistribute it and/or modify it under the terms of the
 * GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * ss12-gtprojects is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 * Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ss12-gtprojects.
 *
 * If not, see <http://www.gnu.org/licenses/>.
 */

#include "StrategicGame.h"

#include <string>
#include <vector>

#include "Event.h"
#include "Player.h"

StrategicGame::StrategicGame(std::string n)
    : name(n),
      players(std::vector<Player*>()),
      eventMatrix(std::vector<size_t>()),
      events(std::vector<Event*>()) {}

StrategicGame::~StrategicGame() {
    for (std::vector<Player*>::iterator it = players.begin();
         it != players.end();
         it++) {
        delete *it;
    }

    for (std::vector<Event*>::iterator it = events.begin();
         it != events.end();
         it++) {
        delete *it;
    }
}

void StrategicGame::addPlayer(Player *player) {
    players.push_back(player);
}

void StrategicGame::addEventMatrixEntry(size_t id) {
    eventMatrix.push_back(id);
}

void StrategicGame::addEvent(Event *event) {
    events.push_back(event);
}
